<%-- 
    Document   : chitietsanpham
    Created on : Dec 6, 2013, 2:57:30 PM
    Author     : QuocMinh
--%>

<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt" %>

<c:set var="promotion_start" value="${(ngayHienTai >= khuyenMai.getNgayBatDau()) && (ngayHienTai <= khuyenMai.getNgayKetThuc()) && (khuyenMai.getTinhTrangKhuyenMai() == 1)}" ></c:set>

<t:layout>
    <jsp:body>
        <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/tabcontent.css" />">
        <script type="text/javascript" src="<c:url value="/resources/js/tabcontent.js" />"></script>

        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tbody>
                <tr>
                    <td class="bgtitle">
                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                            <tbody>
                                <tr>
                                    <td width="20">
                                        <img src="<c:url value="/resources/images/mui_ten.gif" />">
                                    </td>
                                    <td valign="bottom" class="title">
                                        <a href="<c:url value="/" />" class="linkcat20">Máy ảnh</a> 
                                        <img src="<c:url value="/resources/images/linev2.jpg" />"> 
                                        <a href="productdetail[0].link" class="linkcat20">
                                            ${sanPham.getHang().getTenHang()}
                                        </a>
                                    </td>
                                    <td width="10" valign="bottom">&nbsp;</td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <img src="<c:url value="/resources/images/space.gif" />" width="1" height="10">
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <table width="100%" style="border-collapse: collapse" border="0" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
                            <tbody>
                                <tr>
                                    <!-- Khung ảnh -->
                                    <td valign="top" width="250">
                                        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tbody>
                                                <!-- Đường trên khung ảnh -->
                                                <tr>
                                                    <td>
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td width="11">
                                                                        <img src="<c:url value="/resources/images/tbl_pro1.jpg" />" width="11" height="11">
                                                                    </td>
                                                                    <td background="<c:url value="/resources/images/tbl_pro2.jpg" />">
                                                                        <img src="<c:url value="/resources/images/tbl_pro2.jpg" />" width="1" height="11">
                                                                    </td>
                                                                    <td width="11">
                                                                        <img src="<c:url value="/resources/images/tbl_pro3.jpg" />" width="11" height="11">
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <!-- Khung ảnh -->
                                                <tr>
                                                    <td>
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro4.jpg" />'); background-repeat:repeat-y; background-position:left top">
                                                                        <img src="<c:url value="/resources/images/tbl_pro4.jpg" />" width="11" height="1">
                                                                    </td>
                                                                    <td>
                                                                        <div align="center">     
                                                                            <!-- Thay đổi ở đây -->
                                                                            <img src="<c:url value="/resources/images/product/${sanPham.getHinh()}" />" alt="${sanPham.getTenSanPham()}" width="180" border="0">
                                                                        </div>
                                                                    </td>
                                                                    <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro5.jpg" />'); background-repeat:repeat-y; background-position:right top">
                                                                        <img src="<c:url value="/resources/images/tbl_pro5.jpg" />" width="11" height="1">
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <!-- Đường dưới khung ảnh -->
                                                <tr>
                                                    <td>
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td width="11">
                                                                        <img src="<c:url value="/resources/images/tbl_logo6.jpg" />" width="11" height="11">
                                                                    </td>
                                                                    <td background="<c:url value="/resources/images/tbl_logo7.jpg" />">
                                                                        <img src="<c:url value="/resources/images/tbl_logo7.jpg" />" width="1" height="11">
                                                                    </td>
                                                                    <td width="11">
                                                                        <img src="<c:url value="/resources/images/tbl_logo8.jpg" />" width="11" height="11">
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                    <td width="30">&nbsp;</td>
                                    <!-- Thông tin chính của máy ảnh -->
                                    <td valign="top">
                                        <!-- Tên của máy ảnh -->
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                            <tbody>
                                                <tr> 
                                                    <td class="title16">
                                                        <!-- Thay đổi ở đây -->
                                                        <strong>${sanPham.getTenSanPham()}</strong>
                                                        <c:if test="${promotion_start == true}" >
                                                            <img src="/templates/images/sale.png" style="margin-left: 15px; position: absolute;">
                                                            <span style="margin-left: 70px; color: red">
                                                                ${khuyenMai.getPhanTram()}%
                                                            </span>
                                                        </c:if>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <img src="<c:url value="/resources/images/space.gif" />" height="10">
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <!-- Thông tin chính của máy ảnh -->
                                        <table width="85%" border="0" cellpadding="5" cellspacing="0">
                                            <tbody>
                                                <tr>
                                                    <td class="brd_bott">
                                                        <strong>Giá tại MPShop:</strong>
                                                    </td>

                                                    <td class="brd_bott">
                                                        <!-- Thay đổi ở đây -->
                                                        <span class="<c:if test="${promotion_start == true}" >fontgrayprice</c:if><c:if test="${promotion_start == false}" >fontred</c:if>">
                                                            <c:if test="${promotion_start == true}" >
                                                                <strong>
                                                                </c:if>
                                                                <fmt:formatNumber type="number" value="${sanPham.getDonGia()}" /> VNĐ
                                                                <c:if test="${promotion_start == true}" >
                                                                </strong>
                                                            </c:if>
                                                        </span>
                                                        <c:if test="${promotion_start == true}" >
                                                            <img src="<c:url value="/resources/images/sale_arrow.png" />" style="position: absolute; margin-top: -11px; margin-left: 11px;">
                                                            <span class="fontred" style="margin-left: 49px;">
                                                                <fmt:formatNumber type="number" value="${sanPham.getDonGia()*(100-khuyenMai.getPhanTram())/100}" /> VNĐ
                                                            </span>
                                                        </c:if>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="30%" class="brd_bott">
                                                        <strong>Giá hãng:</strong>
                                                    </td>
                                                    <td class="brd_bott">
                                                        <span class="fontgrayprice">
                                                            <!-- Thay đổi ở đây -->
                                                            <strong>
                                                                <fmt:formatNumber type="number" value="${sanPham.getDonGia()}" /> VNĐ
                                                            </strong>
                                                        </span> 
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="brd_bott">
                                                        <strong>Khuyến mãi:</strong>
                                                    </td>
                                                    <!-- Thay đổi ở đây -->
                                                    <td class="brd_bott"></td>
                                                </tr>
                                                <tr>
                                                    <td class="brd_bott">
                                                        <strong>Bảo hành:</strong>
                                                    </td>
                                                    <!-- Thay đổi ở đây -->
                                                    <td class="brd_bott">${sanPham.getBaoHanh()} tháng chính hãng trên toàn quốc</td>
                                                </tr>
                                                <tr>
                                                    <td class="brd_bott">
                                                        <strong>Màu sắc:</strong>
                                                    </td>
                                                    <td class="brd_bott">
                                                        <table border="0" cellpadding="0" cellspacing="0">
                                                            <tbody>
                                                                <tr>
                                                                    <!-- Thay đổi ở đây, vòng lặp cả 2 td -->
                                                                    <c:forEach var="mau" items="${sanPham.getMauSanPhams()}" >
                                                                        <td>
                                                                            <img src="<c:url value="/resources/images/color/${mau.getMau().getTenMau()}.png" />" alt="">
                                                                        </td>
                                                                    </c:forEach>
                                                                    <td width="5">&nbsp;</td
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="brd_bott">
                                                        <strong>Kho hàng:</strong>
                                                    </td>
                                                    <!-- Thay đổi ở đây -->
                                                    <td class="brd_bott">
                                                        <c:choose>
                                                            <c:when test="${(sanPham.getSoLuongTon() - sanPham.getSoLuongDangMua()) > 0}">
                                                                Còn hàng
                                                            </c:when>
                                                            <c:otherwise>
                                                                <span class="fontred">Hết hàng</span>
                                                            </c:otherwise>
                                                        </c:choose>
                                                    </td>
                                                </tr>
                                                <!-- Không biết làm, bỏ
                                                <tr>
                                                    <td class="brd_bott">
                                                        <strong>Lượt xem:</strong>
                                                    </td>
                                                    <td class="brd_bott">1298</td>
                                                </tr>
                                                -->

                                                <!-- Nút mua hàng, kiểm tra xem login hay chưa? -->
                                                <tr>
                                                    <td>&nbsp;</td>
                                                    <td>
                                                        <br>
                                                        <table border="0" cellpadding="0" cellspacing="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td>
                                                                        <form action="<c:url value="/" />GioHang/Them/${sanPham.getMaSp()}" method="post" style="margin:0">
                                                                            <!-- Thay đổi ở đây -->
                                                                            <input type="hidden" name="idcth" value="361">
                                                                            <input type="hidden" name="proname" value="Nikon Coolpix S4300">
                                                                            <input type="hidden" name="price" value="2990000">
                                                                            <input type="hidden" name="poids" value="139">
                                                                            <input type="hidden" name="img" value="./upload/posts/361.jpg">
                                                                            <c:if test="${(sanPham.getSoLuongTon() - sanPham.getSoLuongDangMua()) > 0}">
                                                                                <input type="image" src="<c:url value="/resources/images/but-book.jpg" />">
                                                                            </c:if>
                                                                        </form>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <br>
                        <!-- 3 menu cố định -->
                        <div id="pettabs" class="indentmenu">
                            <ul>
                                <li>
                                    <a href="#" rel="dog1" class="selected">
                                        <strong>Chi tiết sản phẩm</strong>
                                    </a>
                                </li>
                                <li>
                                    <a href="#" rel="dog2" class="">
                                        <strong>Bài viết sản phẩm</strong>
                                    </a>
                                </li>
                                <li>
                                    <a href="#" rel="dog3" class="">                   
                                        <strong>Ý kiến khách hàng</strong>
                                    </a>
                                </li>
                            </ul>
                            <br style="clear: left">
                        </div>

                        <!-- Chọn menu nào thì tab đó xuất hiện -->
                        <div style="border:1px solid #CCCCCC; width:750px; padding-bottom:10px; padding-left:10px; padding-right:10px; padding-top:10px;">
                            <!-- Dog 1, chèn nội dung vào đây --->
                            <div id="dog1" class="tabcontent" style="display: block;">
                                ${sanPham.getChiTietSanPham().getHinh()}
                            </div>

                            <!-- Dog 2, chèn nội dung vào đây --->
                            <div id="dog2" class="tabcontent" style="display: none;">

                            </div>

                            <!-- Dog 3, chèn nội dung vào đây --->
                            <div id="dog3" class="tabcontent" style="display: none;">
                                <script language="JavaScript" type="text/javascript">
                                    function CheckfbcusForm(theForm)
                                    {
                                        with (theForm)
                                        {
                                            if (name.value == "")
                                            {
                                                alert("Vui lòng nhập Họ và tên.");
                                                name.focus();
                                                return false;
                                            }
                                            if (content.value == "")
                                            {
                                                alert('Vui lòng nhập nội dung comment.')
                                                content.focus()
                                                return false
                                            }
                                            if (codeprotect.value == "")
                                            {
                                                alert('Vui lòng nhập mã bảo vệ.')
                                                codeprotect.focus()
                                                return false
                                            }
                                            if (codeprotect.value != codeprotect2.value)
                                            {
                                                alert('Mã bảo vệ không đúng. Vui lòng nhập lại mã bảo vệ.')
                                                codeprotect.focus()
                                                return false
                                            }
                                            return true
                                        }
                                    }
                                </script>
                                <form action="addfbcus.php" name="fbcusForm" enctype="multipart/form-data" style="margin:0; padding:0" onsubmit="return CheckfbcusForm(this)">
                                    <input type="hidden" name="idnewscat" value="37">
                                    <input type="hidden" name="idnews" value="361">
                                    <input type="hidden" name="tieudeurl" value="Nikon-Coolpix-S4300">
                                    <br>
                                    <table width="60%" border="0" cellspacing="0" cellpadding="4">
                                        <tbody>
                                            <tr>
                                                <td width="25%" valign="top">Họ tên: (*)</td>
                                                <td valign="top">
                                                    <input type="text" name="name" id="name" class="box_input2" style="width:99%">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">Địa chỉ email:</td>
                                                <td valign="top">
                                                    <input type="text" name="email" id="email" class="box_input2" style="width:99%">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">Nội dung: (*)</td>
                                                <td valign="top">
                                                    <textarea name="content" id="content" cols="45" rows="5" class="box_input2" style="width:99%">
                                                    </textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">Mã bảo vệ (*)</td>
                                                <td valign="top">
                                                    <table border="0" cellspacing="0" cellpadding="0">
                                                        <tbody>
                                                            <tr>
                                                                <td width="80">
                                                                    <input type="text" name="codeprotect" id="codeprotect" class="box_input2"></td>
                                                                <td width="10px">&nbsp;</td>
                                                                <td class="title16">1512
                                                                    <!-- Mã bảo vệ, làm sao có ^^ --->
                                                                    <input name="codeprotect2" type="hidden" id="codeprotect2" value="1512">
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">&nbsp;</td>
                                                <td valign="top">
                                                    <input type="image" src="<c:url value="/resources/images/btn_send.jpg" />"> </td>
                                            </tr>
                                            <tr>
                                                <td valign="top">&nbsp;</td>
                                                <td valign="top">&nbsp;</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </form>
                                <table width="100%" border="0" cellpadding="5" cellspacing="0"></table>
                            </div>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>

        <script type="text/javascript">
            var mypets = new ddtabcontent("pettabs")
            mypets.setpersist(true)
            mypets.setselectedClassTarget("link")
            mypets.init(0)
        </script>
        <br>

        <!-- Sản phẩm khác -->
        <table width="100%" align="center" border="0" cellpadding="0" cellspacing="0">
            <tbody>
                <tr>
                    <td class="bgtitle">
                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                            <tbody>
                                <tr>
                                    <td width="10" valign="bottom">&nbsp;</td>
                                    <td width="20">
                                        <img src="<c:url value="/resources/images/mui_ten.gif" />">
                                    </td>
                                    <td valign="bottom" class="title">Sản phẩm khác</td>
                                    <td width="10" valign="bottom">&nbsp;</td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>

                <tr>
                    <td valign="top">
                        <img src="<c:url value="/resources/images/space.gif" />" width="1" height="10">
                    </td>
                </tr>

                <tr> 
                    <td>
                        <table align="center" border="0" cellspacing="0" cellpadding="0">
                            <tbody>
                                <!-- 3 tr, mỗi tr có 3 td-->
                                <c:forEach var="sanpham" varStatus="sanphamCounter" items="${listSanPham}">
                                    <c:if test="${sanphamCounter.count <= 3}">
                                        <c:if test="${sanphamCounter.count % 3 == 1}">
                                            <tr>
                                            </c:if>
                                            <td valign="top">
                                                <input name="idprocheck[]" type="hidden" value="259">
                                                <table width="260" border="0" align="center" cellpadding="0" cellspacing="0">
                                                    <tbody>
                                                        <tr>
                                                            <td> 
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td width="11">
                                                                                <img src="<c:url value="/resources/images/tbl_pro1.jpg" />" width="11" height="11">
                                                                            </td>
                                                                            <td background="<c:url value="/resources/images/tbl_pro2.jpg" />">
                                                                                <img src="<c:url value="/resources/images/tbl_pro2.jpg" />" width="1" height="11">
                                                                            </td>
                                                                            <td width="11">
                                                                                <img src="<c:url value="/resources/images/tbl_pro3.jpg" />" width="11" height="11">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro4.jpg" />'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
                                                                            <td>
                                                                                <img src="<c:url value="/resources/images/posts.gif" />">&nbsp;
                                                                                <!-- Sửa -->
                                                                                <a href="<c:url value="/" />" class="linktitlebox">Máy ảnh</a> | 
                                                                                <a href="<c:url value="/" />ChiTietSanPham/${sanpham.getMaSp()}" class="linktitlebox">${sanpham.getMaSp()}</a>
                                                                                <!-- Check -->
                                                                                <c:if test="${promotion_start == true}" >
                                                                                    <span style="float: right; font-weight: bold; margin-top: 2px; color:red">${khuyenMai.getPhanTram()}%</span>
                                                                                    <img src="<c:url value="/resources/images/sale.png" />" style="float: right;">
                                                                                </c:if>
                                                                            </td>
                                                                            <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro5.jpg" />'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro4.jpg" />'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
                                                                            <td height="270">
                                                                                <div align="center">
                                                                                    <table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
                                                                                        <tbody>
                                                                                            <tr>
                                                                                                <td align="left">
                                                                                                    <!-- Sửa -->
                                                                                                    <a style="cursor:hand" href="<c:url value="/" />ChiTietSanPham/${sanpham.getMaSp()}"> 
                                                                                                        <img src="<c:url value="/resources/images/product/${sanpham.getHinh()}" />" alt="${sanpham.getTenSanPham()}" width="180" height="260" border="0"> 
                                                                                                    </a>
                                                                                                </td>
                                                                                            </tr>
                                                                                        </tbody>
                                                                                    </table>
                                                                                </div>
                                                                            </td>
                                                                            <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro5.jpg" />'); background-repeat:repeat-y; background-position:right top">&nbsp;</td>
                                                                        </tr>
                                                                        <tr>
                                                                            <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro4.jpg" />'); background-repeat:repeat-y; background-position:left top">&nbsp;</td>
                                                                            <td height="50" valign="top">
                                                                                <div align="center">
                                                                                    <h3 style="margin:0px;">
                                                                                        <!-- Sửa -->
                                                                                        <a style="cursor:hand" href="<c:url value="/" />ChiTietSanPham/${sanpham.getMaSp()}" class="linkblack">${sanpham.getTenSanPham()}</a>
                                                                                    </h3>
                                                                                    <span class="<c:if test="${promotion_start == true}" >fontgrayprice</c:if><c:if test="${promotion_start == false}" >fontred</c:if>">
                                                                                        <fmt:formatNumber type="number" value="${sanpham.getDonGia()}" /> VNĐ
                                                                                    </span>
                                                                                    <br>
                                                                                    <!-- Check -->
                                                                                    <c:if test="${promotion_start == true}" >
                                                                                        <img src="<c:url value="/resources/images/sale_arrow.png" />" style="position: absolute; margin-top: -11px; margin-left: -60px;">
                                                                                        <span class="fontred">
                                                                                            <fmt:formatNumber type="number" value="${sanpham.getDonGia()*(100-khuyenMai.getPhanTram())/100}" /> VNĐ          
                                                                                        </span>
                                                                                        <br>
                                                                                    </c:if>
                                                                                </div>
                                                                            </td>
                                                                            <td width="11" style="background-image:url('<c:url value="/resources/images/tbl_pro5.jpg" />'); background-repeat:repeat-y; background-position:right top">
                                                                                &nbsp;
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>
                                                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                                    <tbody>
                                                                        <tr>
                                                                            <td width="11">
                                                                                <img src="<c:url value="/resources/images/tbl_pro6.jpg" />" width="11" height="44">
                                                                            </td>
                                                                            <td background="<c:url value="/resources/images/tbl_pro7.jpg" />" style="padding-bottom:3px">
                                                                                <form action="<c:url value="/" />GioHang/Them/${sanpham.getMaSp()}" method="post" style="margin:0">
                                                                                    <table border="0" align="center" cellpadding="2" cellspacing="0">
                                                                                        <!-- Sửa -->
                                                                                        <input type="hidden" name="idcth" value="productid">
                                                                                        <input type="hidden" name="proname" value="productname">
                                                                                        <input type="hidden" name="price" value="price">
                                                                                        <input type="hidden" name="poids" value="">
                                                                                        <input type="hidden" name="img" value="product_hot_item.image">
                                                                                        <tbody>
                                                                                            <tr>
                                                                                                <!-- Nút chi tiết  -->
                                                                                                <td>
                                                                                                    <a style="cursor:hand" href="<c:url value="/" />ChiTietSanPham/${sanpham.getMaSp()}">
                                                                                                        <img src="<c:url value="/resources/images/but-detail.jpg" />" border="0">
                                                                                                    </a>
                                                                                                </td>
                                                                                                <td width="2">
                                                                                                    <img src="<c:url value="/resources/images/space.gif" />" width="2">
                                                                                                </td>
                                                                                                <!--nut mua-->
                                                                                                <td>
                                                                                                    <c:choose>
                                                                                                        <c:when test="${(sanpham.getSoLuongTon() - sanpham.getSoLuongDangMua()) > 0}">
                                                                                                            <input type="image" src="<c:url value="/resources/images/but-book.jpg" />"></a>
                                                                                                        </c:when>
                                                                                                        <c:otherwise>
                                                                                                            <span class="fontred">Hết hàng</span>
                                                                                                        </c:otherwise>
                                                                                                    </c:choose>
                                                                                                </td>
                                                                                            </tr>
                                                                                        </tbody>
                                                                                    </table>
                                                                                </form>
                                                                            </td>
                                                                            <td width="11">
                                                                                <img src="<c:url value="/resources/images/tbl_pro8.jpg" />" width="11" height="44">
                                                                            </td>
                                                                        </tr>
                                                                    </tbody>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                            <c:if test="${sanphamCounter.count % 3 == 3}">
                                            </tr>
                                        </c:if>
                                    </c:if>
                                </c:forEach>
                                <tr>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
    </jsp:body>
</t:layout>